package com.wangcanxuan.www.util.pool.handler;

import com.wangcanxuan.www.util.ConnectionPoolUtil;
import com.wangcanxuan.www.util.pool.PooledConnection;

import java.sql.SQLException;


/**
 * 策略工厂接口
 *
 * @author HHLJ
 * @date 2022/04/13
 */
public interface RejectedConnectionHandler {
    /**
     * 拒绝连接策略
     *
     * @param connection     连接
     * @param connectionPool 连接池
     * @throws SQLException         sqlexception异常
     * @throws InterruptedException 中断异常
     */
    void rejectedConnection(PooledConnection connection, ConnectionPoolUtil connectionPool) throws SQLException, InterruptedException;
}
